//
//  ViewController.m
//  DNFhezi
//
//  Created by 朱兴隆 on 16/5/5.
//  Copyright © 2016年 毛毛. All rights reserved.
//

#import "ViewController.h"
#import "GXSlideSegmentController.h"

#import "RecommendController.h"
#import "VideoController.h"
#import "EntertainmentController.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.navigationController.interactivePopGestureRecognizer.enabled = NO;
    
    /**
     *  ZXL的分支里写了这句话
     */
    
    
    
    // add viewControllers
    NSMutableArray *vcs = [NSMutableArray array];
    RecommendController *recommedVC = [[RecommendController alloc] init];
    recommedVC.title = @"推荐";
    VideoController *videoVC = [[VideoController alloc] init];
    videoVC.title = @"视频";
    EntertainmentController *enterVC = [[EntertainmentController alloc] init];
    enterVC.title = @"娱乐";

    /**
     *  MM 的分支里 写了这句话
     */
    
    [vcs addObject:recommedVC];
    [vcs addObject:videoVC];
    [vcs addObject:enterVC];
    
    
//    for (int i = 0; i < 10; i++) {
//        UIViewController *vc = [[UIViewController alloc] init];
//        vc.title = [NSString stringWithFormat:@"%d", i];
//        vc.view.backgroundColor = [UIColor colorWithRed:((255.0 * (i%2)) / 255) green:((255.0 * ((i+1)%2)) / 255) blue:((255.0 * ((i+2)%2)) / 255) alpha:1];
//        
//        
//        
//        UILabel *label = [[UILabel alloc] initWithFrame:vc.view.bounds];
//        
//        label.text = [NSString stringWithFormat:@"%d", i];
//        label.textAlignment = NSTextAlignmentCenter;
//        label.font = [UIFont fontWithName:@"MarkerFelt-Thin" size:100];
//        label.textColor = [UIColor purpleColor];
//        label.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleTopMargin | UIViewAutoresizingFlexibleBottomMargin;
//        [vc.view addSubview:label];
//        
//        [vcs addObject:vc];
//    }
    
    GXSlideSegmentController *slideSegmentController = [[GXSlideSegmentController alloc] initWithViewControllers:vcs];
    
    
    slideSegmentController.title = @"GXSlideSegmentController";
    slideSegmentController.indicatorInsets = UIEdgeInsetsMake(0, 8, 0, 8);
    slideSegmentController.indicator.backgroundColor = [UIColor redColor];
    slideSegmentController.indicator.layer.cornerRadius = slideSegmentController.indicator.frame.size.height/2;
    
    [self.navigationController pushViewController:slideSegmentController animated:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
